#include "foo1.h"
#include "foo2.h"

#include <stdio.h>
#include <dlfcn.h>

void callfoo2(void)
{
	/*
	printf("enter @ func:%s , line:%3d , file:%s .\n",__FUNCTION__, __LINE__, __FILE__);

	void *dp=NULL;
	float (*pgetfloatpoint)(void);
	char *error=NULL;

	if(!(dp=dlopen("./libfoo2.so", RTLD_LAZY)))
	{
		printf("load libfoo2.so failed at foo1.\n");
		return ;
	}

	pgetfloatpoint=(float (*) (void) )dlsym(dp, "getfloatpoint");
	error=dlerror();
	if(error)
	{
		printf("dlerror exit at foo1.\n");
		return ; 
	}
	float res=pgetfloatpoint();
	
	printf("getfloatpoint/libfoo2 @ func:%s , line:%3d , file:%s , res is from libfoo2.so =%4.3f.\n",__FUNCTION__, __LINE__, __FILE__, res);

	dlclose(dp);

	printf("exit @ func:%s , line:%3d , file:%s .\n",__FUNCTION__, __LINE__, __FILE__);
	*/
	
	/*alex@tips: return void; is not vaild for void return type functions!!*/
	
	float res=getfloatpoint();
	
	printf("III getfloatpoint/libfoo2 @ func:%s , line:%3d , file:%s , res is from libfoo2.so =%4.3f.\n",__FUNCTION__, __LINE__, __FILE__, res);

}

